using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;

namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class BaikeSnapshotMap : EntityTypeConfiguration<BaikeSnapshot>
    {
        public BaikeSnapshotMap()
        {
            // Primary Key
            this.HasKey(t => t.Baike_id);

            // Properties
            this.Property(t => t.Baike_id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Titile)
                .HasMaxLength(500);

            this.Property(t => t.Link)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("BaikeSnapshot");
            this.Property(t => t.Baike_id).HasColumnName("Baike_id");
            this.Property(t => t.Titile).HasColumnName("Titile");
            this.Property(t => t.Content).HasColumnName("Content");
            this.Property(t => t.Link).HasColumnName("Link");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
        }
    }
}
